<template>
  <div class="device Ipb padding_16">
    <van-row class="van-hairline--bottom text_align_center overflow_hidden">
      <van-col :span="24">
        <img
          :src="deviceObj.fileName"
          class="width_70 height_70 object_fit_cover border_radius_8"
        />
      </van-col>
      <van-col :span="24">
        <p class="margin_bottom_8 font_size_16">
          <b>{{ deviceObj.equipmentName }}</b>
        </p>
        <p>
          <van-button size="small" @click="getState">获取状态</van-button>
          <van-button size="small" class="margin_left_16" @click="refreshFn"
            >刷新</van-button
          >
        </p>
      </van-col>
    </van-row>
    <van-row gutter="10" class="margin_top_8 font_size_14">
      <van-col :span="12" class="margin_top_8"
        ><p
          class="bg_10b928 color_FFF padding_4 border_radius_4 line_height_1 van-ellipsis"
        >
          是否在线:{{ deviceObj.equipmentStatusText }}
        </p></van-col
      >
      <van-col :span="12" class="margin_top_8"
        ><p
          class="bg_10b928 color_FFF padding_4 border_radius_4 line_height_1 van-ellipsis"
        >
          设备状态：{{ deviceObj.onOffText }}
        </p></van-col
      >
      <van-col
        class="margin_top_8"
        :span="12"
        v-for="(item, parameterArrIndex) in deviceObj.parameterArr"
        :key="parameterArrIndex"
        ><p
          class="bg_10b928 color_FFF padding_4 border_radius_4 line_height_1 van-ellipsis"
        >
          {{ item.description }}：{{ item.defaultValue }}
        </p></van-col
      >
    </van-row>
    <van-row
      type="flex"
      justify="start"
      align="center"
      class="margin_bottom_8 margin_top_8 font_size_14"
    >
      <van-col :span="8">
        播放设置：
      </van-col>
      <van-col :span="16" class="text_align_right">
        <el-select
          v-model="audioFile"
          size="small"
          class="width_100"
          placeholder="请选择"
        >
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <el-input-number
          class="margin_left_8"
          size="small"
          v-model="wind"
          @change="volume"
          :min="1"
          :max="10"
          label="描述文字"
        ></el-input-number>
      </van-col>
    </van-row>
    <van-row type="flex" justify="start" align="middle" class="font_size_14">
      <van-col :span="8">
        播放启停：
      </van-col>
      <van-col :span="16" class="text_align_right">
        <van-switch
          size="18px"
          v-model="switchValue"
          active-color="#13ce66"
          inactive-color="#ccc"
          @change="changeSwitch"
        />
      </van-col>
    </van-row>
  </div>
</template>

<script src="./Ipb.js" />
